import com.pbking.logging.Logger;
/**
 * @author Jason Crist
 */
class com.pbking.logging.LogObject {

	// VARIABLES //////////

	private var _message;
	private var _severity:Number;
	private var _className:String;
	private var _methodName:String;
	private var _time:Date;

	// CONSTRUCTION //////////

	function LogObject(message, severity:Number, className:String, methodName:String){

		if(severity == null) severity = Logger.FINEST;
		if(message == null) message = "(no message)";

		this._message = message;
		this._severity = severity;
		this._className = className;
		this._methodName = methodName;
		this._time = new Date();
		
	}
	
	// GETTERS //////////
	
	public function get message() { return this._message; }
	public function get severity():Number { return this._severity; }
	public function get className():String { return this._className; }
	public function get methodName():String { return this._methodName; }
	public function get time():Date { return this._time; }
	
	// PUBLIC FUNCTIONS //////////
	
	public function toString():String
	{
		var returnString = ".: " + severity + " | " + message + " | ";
		if (className != null && className != undefined) returnString += "class: " + className + " | ";
		if (methodName != null && methodName != undefined) returnString += "method: " + methodName + " | ";
		returnString += time.toLocaleString();
		
		return returnString;
	}
		
}